{%- extends "basic/layout.html" %}

{%- block extrahead %}
{{ super() }}
<link rel="stylesheet" href="{{ pathto('_static/custom.css', 1) }}" type="text/css" />
{% if theme_touch_icon %}
<link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
{% endif %}
{% if theme_canonical_url %}
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html" />
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
<meta http-equiv="refresh" content="3; URL='https://docs.dagster.io/'" /> 
{% endblock %}

{# top+bottom related navs; we also have our own in sidebar #}
{%- macro rellink_markup() %}
<nav id="rellinks">
    <ul>
        {%- if prev and not "no title" in prev.title %}
        <li>
            &larr;
            <a href="{{ prev.link|e }}" title="Previous document">{{ prev.title }}</a>
        </li>
        {%- endif %}
        <li>
            <a href="/" title="Home">Home</a>
        </li>
        {%- if next %}
        <li>
            <a href="{{ next.link|e }}" title="Next document">{{ next.title }}</a>
            &rarr;
        </li>
        {%- endif %}
    </ul>
</nav>
{%- endmacro %}

{%- set theme_show_relbar_top = theme_show_relbar_top or theme_show_relbars %}
{%- set theme_show_relbar_bottom = theme_show_relbar_bottom or theme_show_relbars %}

{# removed existing top+bottom related nav, and embed in main content #}
{%- block relbar1 %}{% endblock %}
{%- block relbar2 %}{% endblock %}

{# Nav should appear before content, not after #}
{%- block content %}
{% if pagename == 'index' %}
<div class="dagster">
    <div class="logo_img">
        <img
            src="https://user-images.githubusercontent.com/28738937/44878798-b6e17e00-ac5c-11e8-8d25-2e47e5a53418.png" />
    </div>

    <h2>
        We have moved to our new documentation site
    </h2>
    <p>
        You are being redirected, please click 
        <a href="https://docs.dagster.io">docs.dagster.io</a> 
        if your browser does not redirect you.
    </p>
    </div>
{% else %}

    <div class="top-bar">Check out our new documentation site: <a href="https://docs.dagster.io">docs.dagster.io</a></div>
    {%- if theme_fixed_sidebar|lower == 'true' %}
    <div class="document">
        {{ sidebar() }}
        {%- block document %}
        <div class="documentwrapper">
            {%- if render_sidebar %}
            <div class="bodywrapper">
                {%- endif %}

                {%- block relbar_top %}
                {%- if theme_show_relbar_top|tobool and pagename != 'index' %}
                <div class="related top">
                    &nbsp;
                    {{- rellink_markup () }}
                </div>
                {%- endif %}
                {% endblock %}

                <div class="body" role="main">
                    {% block body %} {% endblock %}
                </div>

                {%- block relbar_bottom %}
                {%- if theme_show_relbar_bottom|tobool and pagename != 'index'%}
                <div class="related bottom">
                    &nbsp;
                    {{- rellink_markup () }}
                </div>
                {%- endif %}
                {% endblock %}

                {%- if render_sidebar %}
            </div>
            {%- endif %}
        </div>
        {%- endblock %}
        <div class="clearer"></div>
    </div>
    {%- else %}
    {{ super() }}
    {%- endif %}
{% endif %}
{%- endblock %}


{%- block footer %}

{% if theme_analytics_id %}
<script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', '{{ theme_analytics_id }}']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);

    (function () {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

</script>
{% endif %}
{%- endblock %}